/*package com.utils.spring.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;


import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.MongoClientOptions.Builder;
import com.mongodb.MongoClientURI;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Configuration
@Import(PropertyConfig.class)

@EnableMongoRepositories(basePackages = "com.kyhd.tuia.mongo")
public class SimpleMongoConfig {
	

	
    @Value("${mongo.db}")
    private String db;
    
    @Value("${mongo.uri}")
    private String uri;
  
    int connectTimeout = 100;
    int socketTimeout = 100;
    
    @Bean
    public Mongo mongo() throws Exception {
    	log.info("uri:"+uri);
    	Builder options = MongoClientOptions.builder()
    	.connectTimeout(connectTimeout)
    	.socketTimeout(socketTimeout);
    	
        return new MongoClient(new MongoClientURI(uri,options));
    }
 
    @Bean
    public MongoTemplate mongoTemplate() throws Exception {
    	
    	log.info("db:"+db);
        return new MongoTemplate(mongo(), db);
    }
}
*/